package com.rao.guli.service.edu.controller;

import com.rao.guli.service.base.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @author mikasafan
 * @create 2021-07-06-9:08
 */
@CrossOrigin
@RestController
@RequestMapping("/user")
public class LoginController {

    @PostMapping("/login")
    @ApiOperation("登录")
    public R login(){
        return R.ok().data("admin","admin");
    }

    @GetMapping("/info")
    @ApiOperation("获取用户信息")
    public R info(){
        return R.ok()
                .data("roles","[admin]")
                .data("name","admin")
                .data("avatar","https://oss.aliyuncs.com/aliyun_id_photo_bucket/default_handsome.jpg");
    }

    @PostMapping("/logout")
    @ApiOperation("登出")
    public R logout(){
        return R.ok();
    }
}
